package com.ytc.data.controller;

import com.ytc.data.model.Data;
import com.ytc.data.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

//获取数据资源
@Controller
@RequestMapping("data")
public class DataController {

    @Autowired
    private DataService dataService;

    //获取数据
    @RequestMapping("/getData")
    @ResponseBody
    public List<Data> getData(String dataRole){
        List<Data> list = dataService.getData(dataRole);
        return list;
    }
}
